package com.kaibes.admin.token;

import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.kaibes.module.token.service.TokenService;
import com.kaibes.web.thymeleaf.ThymeleafConfig;

@Component
public class TokenUtils implements InitializingBean {

    @Autowired
    private TokenService tokenService;
    @Autowired
    private ThymeleafConfig thymeleafConfig;
    
    public long count() {
        return tokenService.count();
    }

	@Override
	public void afterPropertiesSet() throws Exception {
		thymeleafConfig.putStaticVariable("tokenUtils", this);
	}
}
